
#ifndef _MY_CLASS_H_
#define _MY_CLASS_H_

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

class MyClass
{
public:
    MyClass();
    MyClass(int a, int b);
    ~MyClass();

    int add(int a, int b);

    MyClass &operator=(const MyClass &rhs);

    void *operator new(size_t size)
    {
        printf("void* operator new(size_t size),zize:%d \n", size);
        MyClass *myClass = (MyClass *)malloc(size);
        memset(myClass, 0, size);
        return myClass;
    }

    void operator delete(void *ptr)
    {
        printf("void operator delete(void *ptr) \n");
        if (ptr != NULL)
        {
            free(ptr);
        }
    }

    // private:
    //     double add(double a, double b);
private:
    int m_aaa;
};

#endif